package reflection;

/**
 * @Description:
 * @Author: shenpeng
 * @Date: 2020-02-05
 */
public class Employee extends Person {

    public static Integer totalNum = 0; // 员工数

    public int empNo; // 员工编号 公有

    protected String position; // 职位 保护

    private int salary; // 工资   私有

    private void sayHello() {
        System.out.println(String.format("Hello, 我是 %s, 今年 %s 岁, 爱好是%s, 我目前的工作是%s, 月入%s元\n", name,
                age, getHobby(), position, salary));
    }

    private void work() {
        System.out.println(String.format("My name is %s, 工作中勿扰.", name));
    }

    public Employee(String name, String age, String hobby, int empNo, String position, int salary) {
        super(name, age, hobby);
        this.empNo = empNo;
        this.position = position;
        this.salary = salary;
        Employee.totalNum++;
    }
}
